Skip to content

fix(0.x): AbiError.decode resolves overloads by selector - #603

Merged
jxom merged 1 commit into
0.xfrom
fix/abi-error-decode-overloads-0.x
Nov 8, 2026
Merged

jxom merged 1 commit into
0.xfrom
fix/abi-error-decode-overloads-0.x

Conversation

@jxom

@jxom jxom commented Nov 8, 2026

Copy link
Copy Markdown
Member

Follow-up to #598 / #599.

AbiError.decode(abi, name, data) ignored overloads: it decoded data with whichever overload fromAbi picked by name. With error Example() + error Example(uint256), decoding Example(uint256) data by name returned undefined; with several non-zero overloads it decoded with the wrong parameters.

  • AbiError.decode now resolves the overload from the selector in data, like AbiFunction.decodeData.
  • decode.ReturnType distributes over the error and its overloads (bigint | string | undefined for Example() / Example(uint256) / Example(string)).

Backport of the main fix. AbiError.decode(abi, name, data) now resolves the
overload from the selector in data, like AbiFunction.decodeData, and its
return type includes the overloads' inputs.

Amp-Thread-ID: https://ampcode.com/threads/T-01a1bc8e-e129-76ad-b0c4-3188e7e62ad9
Co-authored-by: jxom <jake@tempo.xyz>
@vercel

vercel Bot commented Nov 8, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
ox Ready Ready Preview Nov 8, 2026 8:28pm UTC

Request Review

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 8, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-08T20:20:30.703307Z 8f6a68e PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@github-actions

github-actions Bot commented Nov 8, 2026

Copy link
Copy Markdown
Contributor

Published ox@0.0.0-pr-603-8f6a68e under the pr-603 dist-tag, which follows this pull request until it closes.

pnpm add ox@pr-603
pnpm add ox@0.0.0-pr-603-8f6a68e

@jxom
jxom merged commit 0f76422 into 0.x Nov 8, 2026
14 checks passed
@jxom
jxom deleted the fix/abi-error-decode-overloads-0.x branch November 8, 2026 20:28
@github-actions github-actions Bot mentioned this pull request Nov 8, 2026

This branch was successfully deployed

1 active deployment
Preview — 8f6a68e1 Deployed Nov 8, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants